package com.whj.apipassenger.request;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @Auther: wanghaijun
 * @Date: 2023/1/5 - 01 - 05 - 16:01 
 * @Description: com.whj.internalcommon.request
 */

/**
 * 预估价格的经纬度
 */
@Data
public class ForecastPriceDTO {

    //经度正则匹配范围-180~+180
    private static final String Longitude = "^[\\-\\+]?(0?\\d{1,2}\\.\\d{1,6}|1[0-7]\\d{1}\\.\\d{1,6}|180\\.0{1,6})$";
    //纬度的范围是-90~+90
    public static final String Latitude="^[\\-\\+]?([0-8]?\\d{1}\\.\\d{1,6}|90\\.0{1,6})$";

    @NotBlank(message = "起点的经度不能为空")
    @Pattern(regexp =  Longitude , message = "起点的经度范围不匹配")
    private String depLongitude;

    @NotBlank(message = "起点的纬度不能为空")
    @Pattern(regexp = Latitude, message = "起点的纬度范围不匹配")
    private String depLatitude;

    @NotBlank(message = "终点的经度不能为空")
    @Pattern(regexp = Longitude, message = "终点的经度范围不匹配")
    private String desLongitude;

    @NotBlank(message = "终点的纬度不能为空")
    @Pattern(regexp = Latitude, message = "终点的纬度范围不匹配")
    private String desLatitude;

    @NotBlank(message = "城市码不能为空")
    @Pattern(regexp = "^\\d{6}$", message = "请输入正确的城市码")
    private String cityCode;

    @NotBlank(message = "车辆类型不能为空")
    @Pattern(regexp = "^1$",message = "请输入正确的车辆类型")
    private String vehicleType;

}
